# http://shao-fan.com/blog/git-svn-update-script.html

br=`git branch|grep \*|cut -c3-`

echo "Branch:$br"

echo ""
echo "--- Stashing ---"
git stash

if [ $? -ne 0 ]; then
echo "--- Stashing failed. ---"
exit 127
fi

echo ""
echo "--- Checking out master ---"
git checkout master

echo ""
echo "--- Getting update from SVN ---"
git svn rebase

echo ""
echo "--- Checking out $br ---"
git checkout $br

echo ""
echo "--- Getting update from master ---"
git rebase master

echo ""
echo "--- Restore working space ---"
git stash pop

echo ""
echo "--- Done. ---"
